<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"%>

 <%
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/";
 %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="<%=basePath %>/css/updateVideo.css" />
<link rel="stylesheet" href="<%=basePath %>/css/list.css">
<link href="<%=basePath %>/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath %>/css/formsCSS.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="<%=basePath %>/css/simditor.css" />
<script src="<%=basePath%>/lib/My97DatePicker/WdatePicker.js"></script>
<script src="<%=basePath %>/js/jquery.min.js"></script>
<script src="<%=basePath %>/js/formsJS.js"></script>

<script type="text/javascript">

function checkForm(f){
	
		 	if(f.name.value.replace(/\s/g,'') == ''){
				alert("角色名称不能为空");
				return false;
			}
			
			if(f.intro.value.replace(/\s/g,'') == ''){
				alert("角色说明不能为空");
				return false;
			}
			
			//修改时，判断是否修改当前用户
			if('${type}'=='upd'){
		
				if(loginUser==f.userName.value){
					return true;
				}else{
					alert("只允许修改当前登录账户信息");
					return false;
				}
			}
 
	return true;
}

</script>
</head>
<body>
		<div class="connect_wrap">
    		<h3 style= "text-align: center;">系统用户信息维护</h3>
			<div class="row cl" style="max-width:88%;margin-left:8%;">
			<div class="labelText"></div>
				<form action="<%=basePath%>/sysRole/sysRoleEdit" method="post" onsubmit="return checkForm(this)" name="dataForm"
					enctype="multipart/form-data">
					<div class="col-sm-4"></div>
	    				<div class="col-sm-4">
	    						<div class="boxs">
									<input type="hidden" name="id" value="${sysRole.id}">
									<input type="text" class="inputBox" placeholder="角色名称" name="name" value="${sysRole.name}" >
									<input type="text" class="inputBox" placeholder="角色说明" name="intro" value="${sysRole.intro}" >
									<br><br>
							 
									<input type="submit" value="确定" class="true"   />
									<input type="button"  class="false" value="取消" onclick="window.history.go(-1)">
								</div>
						 </div>
					</form>
			</div>
	</div>
	
</body>
	 
</html>